package com.hdx.server.service.impl;



import com.hdx.server.service.ShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

@Service
public class ShopServiceImpl implements ShopService {

    public static final String KEY = "SHOP_STATUS";
    @Autowired
    private RedisTemplate redisTemplate;
    //设置店铺的营业状态
    @Override
    public void setStatus(Integer status) {
        //将status存入redis
        redisTemplate.opsForValue().set(KEY,status);
    }

    @Override
    public Integer getStatus() {
        Integer status= (Integer) redisTemplate.opsForValue().get(KEY);
        return status;
    }



}
